// Problem: 
// Contest: 
// URL: 
// Memory Limit: 
// Time Limit: 
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define int long long
inline int read(){
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
	return s*w;
}
int gcd(int x,int y)
{
	if(y==0)return x;
	return gcd(y,x%y);
}
signed main()
{
	string s;
	int z[50]={0},m[50]={0},u[50]={0},n=1,i=0;
	bool f=0;
	getline(cin,s);
	while(i!=s.size())
	{
		if(s[i]=='+'||s[i]=='-')
		{
			u[++n]=(s[i]=='-')?1:0;
			f=0;
		}
		else if(s[i]=='/')f=1;
		else 
		{
			if(f==0)z[n]=z[n]*10+s[i]-'0';
			else m[n]=m[n]*10+s[i]-'0';
		}
		i++;
	}
	int ansz=0,ansm=1;
	for(i=1;i<=n;i++)
	{
		int a,b,c,d;
		a=ansz,b=ansm;
		c=z[i],d=m[i];
		if(u[i])ansz=a*d-b*c;
		else ansz=a*d+b*c;
		ansm=b*d;
		int g=gcd(abs(ansz),ansm);
		ansz/=g;
		ansm/=g;
	}
	cout<<ansz;
	if(ansm!=1)cout<<"/"<<ansm;
	return 0;
}
